package admin_service

import (
	"qmp_go_push/models"
	"qmp_go_push/pkg/response"
)

type ShowUserInfoParam struct {
	DBContext *models.DBContext
}
type ShowUserInfoResp struct {
	UserInfo UserInfo `json:"user_info"`
}

type UserInfo struct {
	Phone    string `json:"phone"`
	Nickname string `json:"nickname"`
	UserUuid string `json:"user_uuid"`
	TeamUuid string `json:"team_uuid"`
}

func (param ShowUserInfoParam) ShowUserInfo() (ShowUserInfoResp, response.CustomBizEnum) {
	userInfoRecord := models.GetUserInfoByUserUuid(param.DBContext.GetUserUuid())
	userInfo := UserInfo{
		Phone:    userInfoRecord.Phone,
		Nickname: userInfoRecord.Nickname,
		UserUuid: userInfoRecord.UserUuid,
		TeamUuid: param.DBContext.GetTeamUuid(),
	}
	return ShowUserInfoResp{userInfo}, response.Success
}
